package com.own.business.system.dictionary.entity.map;

import com.own.business.system.dictionary.entity.po.SystemDictionary;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * SystemDictionaryMapVo
 *
 * @author chenxueli
 * @date 2023-06-21 09:42:34
 */
@Schema(title = "系统数据字典" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SystemDictionaryMapVo extends BaseMap<SystemDictionary> {

    @Schema(title = "字典名称")
    private String name;

    @Schema(title = "唯一编号")
    private String code;

    @Schema(title = "图标")
    private String icon;

    @Schema(title = "顺序，默认数字越小约在前面")
    private Integer sortOrder;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public SystemDictionaryMapVo(@NonNull SystemDictionary entity) {
        super(entity);
        this.name = entity.getName();
        this.code = entity.getCode();
        this.icon = entity.getIcon();
        this.sortOrder = entity.getSortOrder();
    }
}
